
#ifndef _MEMBER_BHTMLITEM_H_
#define _MEMBER_BHTMLITEM_H_

#include <BMap>
#include <BXmlNode>
#include <BHtmlItem>
#include <BHtmlWidget>
#include "ILineBlock.h"

#define item_member(item)			((member_BHtmlItem*)((BHtmlItem*)item)->_ptr)

namespace BWE
{
	bool ConvertTextToHtml(BString& text);
	bool ConvertHtmlToText(BString& text);

	class member_BHtmlItem
	{
	public:
		member_BHtmlItem(BHtmlItem* htmlItem);
		~member_BHtmlItem();

		void dirtyHtml();

		void adjustRect(const BPoint& pos);
		BSize freshSize(int width);
		BSize freshListSize(int width);
		BSize freshTableSize(int width);
		BSize freshTreeSize(int width);

		void adjust(int x, int y, int w, int h);
		void adjust(const BPoint& pos, const BSize& size);

		BHtmlItem* findBoxOfId(const BString& id);

		BHtmlItem*			boss;
		BHtmlWidget*		htmlWidget;
		int					fixedWidth;
		int					fixedHeight;

		bool				dirtySize;
		ILineBlock			block;
		Align				align;
		int					spacing;
		BColor				background;
		BColor				color;
		BRect				rect;
		BRect				abRect;
	};
}

#endif
